package com.lagou.task1.work4;

import java.util.List;

public class StudentAdd {

    public static boolean addStudent(Student student, List<Student> list){
        if (list.contains(student)){
            System.out.println("学号为"+student.getNum()+"的学生已存在");
            return false;
        }
        list.add(student);
        System.out.println("添加学生成功");
        return true;
    }

}
